public class Board {
    private final boolean[][] board;

    Board(int x, int y) {
        this.board = new boolean[x][y];
    }

    public boolean[][] getBoard() {
        return board;
    }

    public int getNrOfNeighbours(int x, int y) {
        int rez = 0;

        for (int i = -1; i <= 1; i++) {
            for (int j = -1; j <= 1; j++) {
                try {
                    if ((i != 0) || (j != 0)) {
                        System.out.println(i + " " + j);
                        rez += (board[x + i][y + j] == true ? 1 : 0);
                    }
                } catch (Exception e) {
                }
            }
        }

        return rez;
    }


}
